import { ProfileType } from '@/store/redurce/user';
import request from '@/utils/request';

export const getUserInfoAPI = () => {
  return request({
    url: '/v1_0/user',
  });
};

// 获取用户个人信息profile
export const getUserProfileAPI = () => {
  return request({
    url: '/v1_0/user/profile',
  });
};

// 编辑用户照片资料
export const getUserPhotoAPI = (data: FormData) => {
  return request({
    url: '/v1_0/user/photo',
    method: 'PATCH',
    data,
  });
};

// 编辑用户照片资料
export const updateUserProfileAPI = (data: Partial<ProfileType>) => {
  return request({
    url: '/v1_0/user/profile',
    method: 'PATCH',
    data,
  });
};
